<?php
global $_RQ,$_AR;
$_RQ['op']=$_RQ['op']?$_RQ['op']:'list';
$daytime = mktime(0,0,0,date('m'),date('d'),date('Y'));
$store=pdo_get('jy_weishop_store',array('uniacid'=>$_SESSION['uniacid'],'id'=>$this->store_id));
$return['store']=$store;
$avatar=pdo_getcolumn('core_members',array('id'=>$return['item']['mid']),'avatar');
$return['store']['logo']=$return['store']['logo']?$return['store']['logo']:$avatar;
$return['status1']=pdo_count('jy_weishop_order',array('uniacid'=>$_SESSION['uniacid'],'storeid'=>$this->store_id,'status'=>1));
$return['status2']=pdo_count('jy_weishop_order',array('uniacid'=>$_SESSION['uniacid'],'storeid'=>$this->store_id,'status'=>2));
$return['ispay']=pdo_count('jy_weishop_order',array('uniacid'=>$_SESSION['uniacid'],'storeid'=>$this->store_id,'status'=>0,'ispay'=>0));
$return['goodsnum']=pdo_count('jy_weishop_goods',array('uniacid'=>$_SESSION['uniacid'],'merchid'=>0),'id');
$return['verifygoodsnum']=pdo_count('jy_weishop_verifygoods_log',array('uniacid'=>$_SESSION['uniacid'],'salerid'=>$_SESSION['uid']),'id');
$return['verifynum']=pdo_count('jy_weishop_order_verify',array('uniacid'=>$_SESSION['uniacid'],'clerk_id'=>$_SESSION['uid']),'id');
$return['selfverifynum']=pdo_count('jy_weishop_order_self',array('uniacid'=>$_SESSION['uniacid'],'clerk_id'=>$_SESSION['uid']),'id');
if($perms_mobile){
	$check=strexists($perms_mobile,';jy_weishop/store.manage.order/;');
	if(!$check){
		$return['nocheck_order']=true;
	}
	$check=strexists($perms_mobile,';jy_weishop/store.manage.goods/;');
	if(!$check){
		$return['nocheck_goods']=true;
	}
	$check=strexists($perms_mobile,';jy_weishop/store.manage.store/;');
	if(!$check){
		$return['nocheck_store']=true;
	}
	$check=strexists($perms_mobile,';jy_weishop/store.manage.count/;');
	if(!$check){
		$return['nocheck_count']=true;
	}
	$check=strexists($perms_mobile,';jy_weishop/verify.index/;');
	if(!$check){
		$return['nocheck_verifyindex']=true;
	}
	$check=strexists($perms_mobile,';jy_weishop/verify.verifygoods/;');
	if(!$check){
		$return['nocheck_verifygoods']=true;
	}
	$check=strexists($perms_mobile,';jy_weishop/verify.selfindex/;');
	if(!$check){
		$return['nocheck_selfindex']=true;
	}
}
//获取小程序订阅消息ID	
$tmplIds=array();
if($_SESSION['wxapp_id']){
		$tmpid=cfc('wxapp_api')->get_tpl_template_id('3534',[1,2,3,4],'pay2seller','订单支付成功通知卖方','jy_weishop');
		if($tmpid){
			$tmplIds[]=$tmpid;
		}
		$tmpid=cfc('wxapp_api')->get_tpl_template_id('3534',[1,2,3,4],'send2seller','订单发货通知卖方','jy_weishop');
		if($tmpid){
			$tmplIds[]=$tmpid;
		}
		$tmpid=cfc('wxapp_api')->get_tpl_template_id('3534',[1,2,3,4],'receive2seller','订单确认收货通知卖方','jy_weishop');
		if($tmpid){
			$tmplIds[]=$tmpid;
		}	
}
$return['tmplIds']=$tmplIds;
exi($return);